<?php
  include("include/conn.php");
  require('include/Smarty/libs/Smarty.class.php');

  $msg = "";

  if(isset($_POST['submit']) && $_POST['bhatthipartyName'] == '')
  {
   $msg = "<center><div class='clean-gray'>Enter Bhatthi Party Name ...!!!</div></center><br/>";
  }
  if(isset($_POST['bhatthipartyName']) && $_POST['bhatthipartyName'] != '')
  {
    $insertQueryBhatthipartyName = "insert into bhatthiparty (bhatthipartyName) values ('".$_POST['bhatthipartyName']."')";
    $insertQueryBhatthipartyNameResult = mysql_query($insertQueryBhatthipartyName);
    if(!$insertQueryBhatthipartyNameResult)
    {
      die("Insert Query Not Inserted : ".mysql_error());
    }
	  else
	  {
	    header("Location:bhatthiPartyList.php");
	  }
  }
  $smarty = new Smarty;
  require('bottom.php');
  $smarty->assign("l_addBhatthiParty",$l_addBhatthiParty);
  $smarty->assign("l_bhatthipartyName",$l_bhatthipartyName);

  $smarty->assign("msg",$msg);
  $smarty->display('addBhatthiParty.tpl');
?>